package com.my.commonlibrary.adapter;

import android.content.Context;
import android.view.View;

import com.my.commonlibrary.R;
import com.my.commonlibrary.base.HolderAdapter;
import com.my.commonlibrary.model.LeftMenuEntity;

import java.util.List;


/**
 * Author : Cooper
 * Time : 2016/9/7  16:03
 * Description : 左边菜单List的adapter
 */
public class LeftMenuAdapter extends HolderAdapter<LeftMenuEntity> {

    public LeftMenuAdapter(Context mContext, List<LeftMenuEntity> mDateList) {
        super(mContext, mDateList);
    }

    @Override
    public int buildLayoutView() {
        return R.layout.item_left_menu_layout;
    }

    @Override
    public void buildViewData(Context context, HolderAdapter<LeftMenuEntity>.ViewHolder holder, LeftMenuEntity leftMenuEntity, int position) {
        holder.setImageViewBackgroundId(R.id.icon_iv, leftMenuEntity.icon_rs);
        holder.setText(R.id.menuName_tv, leftMenuEntity.menuName);
        if (position == 3) {
            holder.getView(R.id.divide_line).setVisibility(View.VISIBLE);
        } else {
            holder.getView(R.id.divide_line).setVisibility(View.GONE);
        }
    }
}
